import Vue from "vue";
import axios from "axios";
//888888
//==============================PromiseUtil=================================
const PromiseUtil = {
  //是否为空判断
  isNull: function(text) {
    if (undefined == text) {
      return true;
    }
    if (text.length == "" || text.length == 0) {
      return true;
    }
    return false;
  },
  async connhistory(item) {
    let userSO_json = JSON.parse(sessionStorage.getItem("userSO_json"));
    axios
      .get("/api/retrieveLogController/storageLog?input=" + item+"&userName="+userSO_json.userName,{
        headers: {
          //头部信息
          "Content-Type": "application/json;charset=utf-8",
          token: userSO_json.token
        }
      })
      .then(response => {
        let resultUtils = response.data;
        console.log("我是Promise.js里封装的方法connhistory（）")
        console.log(resultUtils.data);
      })
      .catch(error => {
        console.log(error);
          alert("历史记录存储错误，对接错误");
        
      });
  },
};
Vue.prototype.PromiseUtil = PromiseUtil;
//==============================PromiseUtil=================================
 
 
export default {};